Method and apparatus for restoring motion blurred image

ABSTRACT

A method and an apparatus for restoring a motion blurred image are disclosed. The method of restoring a motion blurred image comprises calculating a motion trajectory and a project trajectory of a camera using an embedded sensor; estimating a point spread function according to camera motion by using the motion trajectory and the project trajectory; and restoring the motion blurred image using the estimated point spread function and a spatially variant activity map.

CROSS REFERENCE TO RELATED APPLICATION

This application claims the priority of Korean Patent Application No. 10-2015-0085274, filed on Jun. 16, 2015 in the KIPO (Korean Intellectual Property Office). Further, this application is the National Phase Application of International Application No. PCT/KR2016/002513 filed Mar. 14, 2016, which designates the United States and was published in Korean. Both of the priority documents are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to a method and an apparatus for restoring a motion blurred image.

BACKGROUND ART

A CCD image sensor or a CMOS image sensor included in a digital camera or a camera phone can read-out electric charge collected by a photoelectric device with constant velocity during an exposure time.

Here, the CCD image sensor or the CMOS image sensor employed in general popular digital camera or camera phone may have small size. Accordingly, in the event that photographing is performed in a room or at night having comparative small amount of lighting, the velocity of the read-out may become slower. In this case, the image sensor increases the exposure time to obtain adequate electric charge, and thus it is sensitive to motion such as hand-shake or moving of an object.

Additionally, since focal length becomes longer or view angle becomes narrower when a zoom function of the camera is used, great motion may be shown on output of an image though small shakiness occurs.

A motion blur may occur to the image by the motion. In the event of reducing arbitrarily the exposure time of the camera to remove the motion blur, the motion blur is reduced but much noise occurs to the image and brightness gets dark.

A conventional method of restoring a motion blurred image estimates a point spread function and restores using the estimated result. A method of minimizing repetitive error and a method of comparing and analyzing images, etc. have been used so as to restore the motion blurred image.

However, the problem exists in that the conventional methods require much repetition and calculation amount or several images taken at different view angles.

SUMMARY

To solve problem of the convention technique, the invention is to provide a method and an apparatus for restoring a high-speed motion blurred image for minimizing occurrence of artifact.

In one embodiment, the present invention is to provide a method of restoring a motion blurred image, the method comprising: calculating a motion trajectory and a project trajectory of a camera using an embedded sensor; estimating a point spread function according to camera motion by using the motion trajectory and the project trajectory; and restoring the motion blurred image using the estimated point spread function and a spatially variant activity map.

Data sensed by the embedded sensor is a gyro data for estimating angular velocity according to shaking of the camera, and the project trajectory follows a Gaussian distribution.

The point spread function is defined as accumulation of trajectory reweighted by using the Gaussian distribution.

The spatially variant activity map is used for removing ringing artifact while an edge is maintained in the motion blurred image.

In another embodiment, an apparatus for restoring a motion blurred image comprising: a processor; and a memory connected to the processor. Here, the memory stores program instructions executable by the processor, to calculate a motion trajectory and a project trajectory of a camera using an embedded sensor, estimate a point spread function according to camera motion by using the motion trajectory and the project trajectory, and restore the motion blurred image using the estimated point spread function and a spatially variant activity map.

A method and an apparatus of the invention estimate a point spread function of an image using an embedded sensor and probabilistic distribution, thereby estimating rapidly the point spread function from a single image and minimizing occurrence of artifact through a spatially variant image restoring method.

BRIEF DESCRIPTION OF DRAWINGS

Example embodiments of the present invention will become more apparent by describing in detail example embodiments of the present invention with reference to the accompanying drawings, in which:

FIG. 1 is a view illustrating a general motion trajectory generation process;

FIG. 2 is a view illustrating motion trajectory according to camera motion;

FIG. 3 is a view illustrating gyro data and projected trajectory; and

FIG. 4(a) and FIG. 4(b) are a view illustration a process of estimating a point spread function of motion.

DETAILED DESCRIPTION

The invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that there is no intent to limit the invention to the particular forms disclosed, but on the contrary, the invention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like numbers refer to like elements throughout the description of the figures.

Hereinafter, embodiments of the invention will be described in detail with reference to accompanying drawings.

FIG. 1 is a view illustrating a general motion trajectory generation process.

As shown in FIG. 1, in the event that an embedded sensor samples different K poses (x_(k), y_(k), k=1, . . . K) according to shaking of a camera during an exposure time of the camera, an object point on three dimensional object space is projected on different K locations in two dimensions.

Particularly, an image point on an image plane is related to an object point by a homogeneous vector as shown in following equation 1.

[x_(k), y_(k), 1]^(T)=∪_(k)[X, Y, Z, 1]^(T)   [Equation 1]

Here, ∪_(k) indicates a project matrix of kth camera.

If a motion trajectory is generated through a spatially invariant method, K points on the image plane generate a point spread function PSF of corresponding motion blur as following.

$\begin{matrix} {{h\left( {m,n} \right)} = {\frac{1}{K}{\sum\limits_{k = 1}^{K}\; {{\delta \left( {{m - x_{k}},{n - y_{k}}} \right)}.}}}} & \left\lbrack {{Equation}\mspace{14mu} 2} \right\rbrack \end{matrix}$

A point spread function h(m,n) for arbitrary coordinate (m, n) is defined as sum of impulse function δ(m−x_(k), n−y_(k)) shifted by x_(k) and y_(k).

In the spatially invariant point spread function, an image degradation model of the motion blur is shown with vector-matrix type as following.

g=Hf+η,   [Equation 3]

Here, g means a motion blurred image, H indicates a degradation matrix, f means an ideal image in which the motion blur does not occur, and η indicates an additive noise.

In the event that size of the image corresponds to N×N, g, f and η are expressed as N²×1 lexicographically order vector, and H indicates a block circulant matrix of N²×N² defined by the point spread function.

A method of the present embodiment analyzes a motion trajectory and calculates a project matrix using an embedded sensor.

To estimate the point spread function of motion, points of each of scenes are projected on an image plane according to the project matrix.

Hereinafter, a process of estimating the point spread function using motion tracking of a camera will be described.

Only relative location of the camera is required for estimating size and shape of the point spread function of the motion.

This is because the point spread function equals to total sum of intensities reflected from first location of motion of the camera to final location of the motion of the camera as shown in equation 2.

Location of respective cameras is projected on the image plane and may be expressed by using planar homography as following.

$\begin{matrix} {\left( {x_{k},y_{k},1} \right)^{T} = {\left\lbrack {{C\left( {R_{k} + {\frac{1}{d}t_{k}n_{v}^{T}}} \right)}C^{- 1}} \right\rbrack \left( {x_{0},y_{0},1} \right)^{T}}} & \left\lbrack {{Equation}\mspace{14mu} 4} \right\rbrack \end{matrix}$

Here, C means an intrinsic matrix of the camera, R indicates a rotation matrix, d means scene depth, t indicates a translation vector, and n, means a normal vector on the image plane.

Relation between motion trajectory and camera translation is shown in FIG. 2, and motion trajectory Δm_(t) on the image plane is calculated by equation 5.

$\begin{matrix} {{\Delta m}_{t} = {\frac{l_{f}}{d}{\Delta t}_{c}}} & \left\lbrack {{Equation}\mspace{14mu} 5} \right\rbrack \end{matrix}$

Here, l_(j) and Δt_(c) indicate focal length and the camera translation, respectively.

If the scene depth is adequately higher than focus distance, the motion trajectory may be neglected. Accordingly, the camera translation does not affect to the point spread function of the motion under the condition that the scene depth is great. As a result, equation 4 is simplified as follows.

(x _(k) , y _(k), 1)^(T)=[CR_(i) C ⁻¹](x ₀ , y ₀, 1)^(T)   [Equation 6]

It is assumed that camera coordinate is arrayed on global coordinate located on an optical axis of the camera.

The camera matrix C is determined by the focus distance as shown in below under the above assumption.

$\begin{matrix} {C = \begin{bmatrix} l_{f} & 0 & 0 \\ 0 & l_{f} & 0 \\ 0 & 0 & 1 \end{bmatrix}} & \left\lbrack {{Equation}\mspace{14mu} 7} \right\rbrack \end{matrix}$

A rotation matrix is calculated through following equation 8 by using small-angle approximation and a spatially invariant motion blur.

$\begin{matrix} {R = \begin{bmatrix} 1 & 0 & \omega_{i}^{y} \\ 0 & 1 & {- \omega_{i}^{x}} \\ {- \omega_{i}^{y}} & \omega_{i}^{x} & 1 \end{bmatrix}} & \left\lbrack {{Equation}\mspace{14mu} 8} \right\rbrack \end{matrix}$

Here, ω_(i) ^(x) and ω_(i) ^(y) mean ith angular velocity surrounding x axis and y axis.

Since l_(f)tan(ω)≈l_(f)ω in the event of small ω, the project matrix may be expressed with following equation 9.

$\begin{matrix} {\left( {x_{k},y_{k},1} \right)^{T} = {\begin{bmatrix} 1 & 0 & {l_{f}\omega_{i}^{y}} \\ 0 & 1 & {l_{f}\omega_{i}^{x}} \\ 0 & 0 & 1 \end{bmatrix}\left( {x_{0},y_{0},1} \right)^{T}}} & \left\lbrack {{Equation}\mspace{14mu} 9} \right\rbrack \end{matrix}$

In one embodiment, the method uses gyro data so as to estimate angular velocity according to camera motion as shown in FIG. 3, and calculates corresponding projected location (project trajectory) on the image plane.

Under ideal condition, the projected trajectory is identical to the point spread function of the camera motion.

However, the gyro data includes noise in real environment. Particularly, the gyro data including the noise brings out mismatching between the location projected on the image plane and real point spread function sample.

To perform robust estimation of the point spread function using the gyro data including the noise, it is assumed that the projected trajectory follows Gaussian distribution in the invention.

As a result, the projected trajectory corresponds to sum of the Gaussian distribution.

$\begin{matrix} {{h\left( {m,n} \right)} = {\frac{1}{K_{G}}{\sum\limits_{k = 1}^{K}\; {G\left( {{m - x_{k}},{n - y_{k}}} \right)}}}} & \left\lbrack {{Equation}\mspace{14mu} 10} \right\rbrack \end{matrix}$

As shown in FIG. 4(a), the point spread function of the camera motion corresponds to accumulation of trajectory reweighted by using the Gaussian distribution.

As shown in FIG. 4(b), the Gaussian distribution is estimated by analysis of gyro data of a fixed camera.

The method of the invention uses a sensor data logger provided in C. Jia and B. Evans, “Probabilistic 3-D motion estimation for rolling shutter video rectification from visual and inertial measurements,” in Proceedings of the IEEE 14th International Workshop on Multimedia Signal Processing (MMSP '12), pp. 203-208, September 2012., so as to obtain gyro data synchronized with a blur frame.

The gyro data and corresponding blurred frame is time-stamped, and opening and closing of a shutter are recorded in order to analyze delay.

Hereinafter, a process of restoring an image through a spatially adaptive (variant) method by using local statistics will be described.

If the point spread function of the motion is estimated, shaking of the motion is solved through a simple process of restoring the image.

Recently, many methods of restoring the image have been provided so as to remove various types of degradation parameter of the image. Since the restoration of the image corresponds to bad condition problem, standardized solution requires occasionally complex calculation.

To remove the motion blur without artifact not desired, the method of restoring the image according to the present embodiment is expressed by using local statistics for minimizing an energy function defined as following equation 11.

$\begin{matrix} {{E(f)} = {{\frac{1}{2}{{{Hf} - g}}_{2}^{2}} + {\frac{\lambda_{1}}{2}{\sum\limits_{i = 1}^{2}\; {{D_{i}f}}_{2}^{2}}} + {W_{m} \cdot \left( {\frac{\lambda_{2}}{2}{\sum\limits_{i = 1}^{2}\; {{{D_{i}f} - {D_{i}{Cg}}}}_{2}^{2}}} \right)}}} & \left\lbrack {{Equation}\mspace{14mu} 11} \right\rbrack \end{matrix}$

Here, ∥·∥ means an Euclidean norm, “◯” indicates an element-wise multiplication operator, W_(m) means a spatially variant activity map, C indicates a high pass filter, λ₁, λ₂ mean respectively a horizontal regularization parameter and a vertical regularization parameter, and D1 and D2 indicate a horizontal differential operator and a vertical differential operator, respectively.

If estimated f has artifact such as ringing or noise amplification, D_(i)f has sharp transition, and so ∥Df−D_(i)C_(g)∥ increases.

Solution of minimization problem is obtained by solving an equation that differential in equation 11 makes 0 as shown in below.

$\begin{matrix} {{{Tf} - b} = 0} & \left\lbrack {{Equation}\mspace{14mu} 12} \right\rbrack \\ {T = {{H^{T}H} + {\lambda_{1}\left( {\sum\limits_{i = 1}^{2}\; {D_{i}^{T}D_{i}}} \right)} + {\lambda_{2}{W_{m} \cdot \left( {\sum\limits_{i = 1}^{2}\; {D_{i}^{T}D_{i}}} \right)}}}} & \left\lbrack {{Equation}\mspace{14mu} 13} \right\rbrack \\ {b = {\left( {H^{T} + {\lambda_{2}{W_{m} \cdot \left( {\sum\limits_{i = 1}^{2}\; {D_{i}^{T}D_{i}}} \right)}C}} \right)g}} & \left\lbrack {{Equation}\mspace{14mu} 14} \right\rbrack \end{matrix}$

Ringing artifact is shown at an edge or nearby of a boundary, and thus the spatially adaptive activity map is used to remove the ringing artifact while the edge is maintained.

$\begin{matrix} {{W_{m}\left( {x,y} \right)} = \frac{1}{{p_{t}{\sigma_{l}^{2}\left( {x,y} \right)}} + 1}} & \left\lbrack {{Equation}\mspace{14mu} 15} \right\rbrack \end{matrix}$

Here, σ₁ ² means a local variance near (x,y) in an input image, and p_(i) indicates a parameter adjustable so that the activity map is distributed at [0,1] as far as possible.

In the present embodiment, p_(t)=1500, at which most excellent performance is realized about 5×5 block for the local variance, is empirically used.

A matrix T corresponds to block-circulant for the spatially invariant point spread function of the motion as shown in equation 13, and thus a linear formula in equation 12 may be solved by using a two-dimensional discrete fourier transform.

Here, and {tilde over (f)}, {tilde over (g)}, {tilde over (h)}, {tilde over (d)} {tilde over (ω)}_(m) and {tilde over (c)} indicate an estimated image, a measurement image, the point spread function, a differential filter, the activity map and discrete fourier transforms of the high pass filter, respectively. Accordingly, the restoring problem is as follows.

$\begin{matrix} {{{{\overset{\sim}{f}\left( {k,l} \right)} =}\quad}{\quad\frac{\left( {{{\overset{\sim}{h}}^{*}\left( {k,l} \right)} + {\lambda_{2}{{\overset{\sim}{w}}_{m}\left( {k,l} \right)}{\sum\limits_{i = 1}^{2}\mspace{11mu} {{{{\overset{\sim}{d}}_{i}\left( {k,l} \right)}}^{2}{\overset{\sim}{c}\left( {k,l} \right)}}}}} \right)}{\begin{matrix} {{{\overset{\sim}{h}\left( {k,l} \right)}}^{2} + {\lambda_{1} {\sum\limits_{i = 1}^{2}\; {{{\overset{\sim}{d}}_{i}\left( {k,l} \right)}}^{2}}} +} \\ { {\lambda_{2} {{\overset{\sim}{w}}_{m}\left( {k,l} \right)} {\sum\limits_{i = 1}^{2}\; {{{\overset{\sim}{d}}_{i}\left( {k,l} \right)}}^{2}}}} \end{matrix}}}} & \left\lbrack {{Equation}\mspace{14mu} 16} \right\rbrack \end{matrix}$

Here, a restore image {circumflex over (f)} is an inverse discrete fourier transform.

On the other hand, the technical features described above can be implemented in the form of program instructions that may be performed using various computer means and can be recorded in a computer-readable medium.

The apparatus for restoring the motion blurred image of the invention may include a processor and a memory.

The processor may include a central processing unit CPU executable a computer program and a virtual machine, etc.

The memory may include a non-volatile storage device such as a fixed hard driver or a detachable storage device. The detachable storage device may have a compact flash unit, an USB memory stick, etc. The memory may include a volatile memory such as various random access memories.

The memory stores program instructions executable by the processor.

The program instructions recorded on the memory can be designed and configured specifically for the present invention or can be a type of medium known to and used by the skilled person in the field of software. Examples of the program of instructions may include not only machine language codes produced by a compiler but also high-level language codes that can be executed by a computer through the use of an interpreter, etc.

The hardware mentioned above can be made to operate as one or more software modules that perform the actions of the embodiments of the invention, and vice versa.

The embodiments of the invention described above are disclosed only for illustrative purposes. A person having ordinary skill in the art would be able to make various modifications, alterations, and additions without departing from the spirit and scope of the invention, but it is to be appreciated that such modifications, alterations, and additions are encompassed by the scope of claims set forth below. 

1. A method of restoring a motion blurred image, the method comprising: calculating a motion trajectory and a project trajectory of a camera using an embedded sensor; estimating a point spread function according to camera motion by using the motion trajectory and the project trajectory; and restoring the motion blurred image using the estimated point spread function and a spatially variant activity map.
 2. The method of claim 1, wherein data sensed by the embedded sensor is a gyro data for estimating angular velocity according to shaking of the camera, and the project trajectory follows a Gaussian distribution.
 3. The method of claim 2, wherein the point spread function is defined as accumulation of trajectory reweighted by using the Gaussian distribution.
 4. The method of claim 1, wherein the step of restoring the motion blurred image includes removing motion blur without an artifact by using local statistics for minimizing an energy function.
 5. The method of claim 4, wherein the energy function is defined by using the motion blurred image, a degradation matrix, an ideal image in which the motion blur does not occur, the spatially variant activity map, a high pass filter, a horizontal regularization parameter, a vertical regularization parameter, a horizontal differential operator and a vertical differential operator.
 6. The method of claim 5, wherein the spatially variant activity map is used for removing a ringing artifact while an edge is maintained in the motion blurred image.
 7. An apparatus for restoring a motion blurred image comprising: a processor; and a memory connected to the processor, wherein the memory stores program instructions executable by the processor, to calculate a motion trajectory and a project trajectory of a camera using an embedded sensor, estimate a point spread function according to camera motion by using the motion trajectory and the project trajectory, and restore the motion blurred image using the estimated point spread function and a spatially variant activity map. 